import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/invite_list_entity.dart';
import 'package:get/get.dart';


InviteListEntity $InviteListEntityFromJson(Map<String, dynamic> json) {
  final InviteListEntity inviteListEntity = InviteListEntity();
  final int? page = jsonConvert.convert<int>(json['page']);
  if (page != null) {
    inviteListEntity.page = page;
  }
  final int? pageSize = jsonConvert.convert<int>(json['pageSize']);
  if (pageSize != null) {
    inviteListEntity.pageSize = pageSize;
  }
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    inviteListEntity.total = total;
  }
  final List<InviteListList>? list = (json['list'] as List<dynamic>?)
      ?.map(
          (e) => jsonConvert.convert<InviteListList>(e) as InviteListList)
      .toList();
  if (list != null) {
    inviteListEntity.list = list;
  }
  return inviteListEntity;
}

Map<String, dynamic> $InviteListEntityToJson(InviteListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['page'] = entity.page;
  data['pageSize'] = entity.pageSize;
  data['total'] = entity.total;
  data['list'] = entity.list?.map((v) => v.toJson()).toList();
  return data;
}

extension InviteListEntityExt on InviteListEntity {
  InviteListEntity copyWith({
    int? page,
    int? pageSize,
    int? total,
    List<InviteListList>? list,
  }) {
    return InviteListEntity()
      ..page = page ?? this.page
      ..pageSize = pageSize ?? this.pageSize
      ..total = total ?? this.total
      ..list = list ?? this.list;
  }
}

InviteListList $InviteListListFromJson(Map<String, dynamic> json) {
  final InviteListList inviteListList = InviteListList();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    inviteListList.id = id;
  }
  final String? email = jsonConvert.convert<String>(json['email']);
  if (email != null) {
    inviteListList.email = email;
  }
  final String? nickName = jsonConvert.convert<String>(json['nickName']);
  if (nickName != null) {
    inviteListList.nickName = nickName;
  }
  final int? invitedCount = jsonConvert.convert<int>(json['invitedCount']);
  if (invitedCount != null) {
    inviteListList.invitedCount = invitedCount;
  }
  final String? inviteCode = jsonConvert.convert<String>(json['inviteCode']);
  if (inviteCode != null) {
    inviteListList.inviteCode = inviteCode;
  }
  final dynamic isOpen = json['isOpen'];
  if (isOpen != null) {
    inviteListList.isOpen = isOpen;
  }
  final dynamic list = json['list'];
  if (list != null) {
    inviteListList.list = list;
  }
  return inviteListList;
}

Map<String, dynamic> $InviteListListToJson(InviteListList entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['email'] = entity.email;
  data['nickName'] = entity.nickName;
  data['invitedCount'] = entity.invitedCount;
  data['inviteCode'] = entity.inviteCode;
  data['isOpen'] = entity.isOpen;
  data['list'] = entity.list;
  return data;
}

extension InviteListListExt on InviteListList {
  InviteListList copyWith({
    String? id,
    String? email,
    String? nickName,
    int? invitedCount,
    String? inviteCode,
    dynamic isOpen,
    dynamic list,
  }) {
    return InviteListList()
      ..id = id ?? this.id
      ..email = email ?? this.email
      ..nickName = nickName ?? this.nickName
      ..invitedCount = invitedCount ?? this.invitedCount
      ..inviteCode = inviteCode ?? this.inviteCode
      ..isOpen = isOpen ?? this.isOpen
      ..list = list ?? this.list;
  }
}